#include <iostream>
#include <functional>
#include <atomic>
using namespace std;

class Foo
{
private:
    atomic<int> count = 0;
public:
    void first(function<void()> printFirst)
    {
        printFirst();
        count.fetch_add(1);
    }
    void second(function<void()> printSecond)
    {
        while (count.load() != 1);
        printSecond();
        count.fetch_add(1);
    }
    void third(function<void()> printThird)
    {
        while (count.load() != 2);
        printThird();
    }
};

int main()
{
    cout << "Code1114" << endl;
    return 0;
}